package contacts.view;

import java.awt.FlowLayout;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import contacts.controller.ContactsControllerListener;

public class LoginFrame extends JFrame{
	private static final long serialVersionUID = -2712822917948835041L;
	private ContactsControllerListener controllerListener;
	private JLabel lab;
	private JLabel lag;
	private JTextField nameTextField;
	private JTextField passWordTextField;
	private JButton loginButton;
	public static String name = "李钦萍";
	public static String passWord = "123456";

	public LoginFrame() {
		this.controllerListener = new ContactsControllerListener();
		this.controllerListener.setLoginFrame(this);
		this.setSize(400, 250);
		this.setFont(new Font("微软雅黑", Font.PLAIN, 25));
		FlowLayout flow = new FlowLayout(FlowLayout.CENTER, 10, 10);
		this.setLayout(flow);
		lab = new JLabel("账号:");
		lab.setFont(new Font("微软雅黑", Font.PLAIN, 25));
		this.add(lab);
		nameTextField = new JTextField(30);
		this.add(nameTextField);
		lag = new JLabel("密码:");
		lag.setFont(new Font("微软雅黑", Font.PLAIN, 25));
		this.add(lag);
		passWordTextField = new JTextField(30);
		this.add(passWordTextField);
		loginButton = new JButton("登录");
		loginButton.addActionListener(controllerListener);
		loginButton.setActionCommand("addLoginDialog");
		this.add(loginButton);
		this.setResizable(false);
		this.setVisible(true);
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		this.setLocationRelativeTo(null);
	}
	public JTextField getNameTextField() {
		return nameTextField;
	}
	public void setNameTextField(JTextField nameTextField) {
		this.nameTextField = nameTextField;
	}
	public JTextField getPassWordTextField() {
		return passWordTextField;
	}
	public void setPassWordTextField(JTextField passWordTextField) {
		this.passWordTextField = passWordTextField;
	}
}
	
   